<?
	session_start();
//	session_register
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Selamat Datang</title>
<script type="text/javascript">
	function logout()
	{
		var ok = confirm("Apakah Anda yakin KELUAR dari aplikasi ini ?");
		if(ok == true)
		{
			window.location.href="../lib/process.php?logout=yes";
			//href="lib/process.php?logout=yes"
		}
		else
		{
		}
	}
</script>
<link rel="stylesheet" type="text/css" href="<?=$path?>/style/style.css" />
<script type="text/javascript" src="<?=$path?>/js/menu_bar.js"></script>
<link rel="stylesheet" type="text/css" href="<?=$path?>/js/menu_bar.css">
<script language="javascript" src="<?=$path?>/js/event.js"></script>
<script language="javascript" src="<?=$path?>/js/calendar.js"></script>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- ImageReady Slices (SURVEYOR copy) -->
<table id="Table_01" width="100%" height="44" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td background="<?=$path?>/images/SURVEYOR-copy_02.gif">
			<img src="<?=$path?>/images/SURVEYOR-copy_01.gif" width="267" height="44" alt=""></td>
		<td background="<?=$path?>/images/SURVEYOR-copy_02.gif">&nbsp;</td>
		<td background="<?=$path?>/images/SURVEYOR-copy_02.gif" align="right">
			<img src="<?=$path?>/images/SURVEYOR-copy_03.gif" width="201" height="44" alt=""></td>
	</tr>
	<tr>
	 <td height="5" bgcolor="#990000" colspan="3"></td>
	</tr>
	<?
		if(trim($HTTP_SESSION_VARS['user_login']) == ""){
			echo"
			<tr>
			 <td align=center colspan=3>
			 <br><br><br>".$_SESSION['user_login']."
				Maaf, Anda tidak bisa mengakses halaman ini, Anda harus login terlebih dahulu ... <br><br>
				[ <a href='$path/index.php'>silahkan login</a> ]
			 </td>
			</tr>
			";
			exit();
		}
	?>
<?
// get hak akses
include("lib/config.php");
// administrasi user
$sadmu	= mssql_query("SELECT * FROM VPrivUser WHERE username='".$_SESSION['user_login']."' AND nama_menu='administrasi_user'",$conn);
$radmu	= mssql_fetch_array($sadmu);
// cvonline
$scvoon = mssql_query("SELECT * FROM VPrivUser WHERE username='".$_SESSION['user_login']."' AND nama_menu='cvonline'",$conn);
$rcvoon = mssql_fetch_array($scvoon);
// report
$srep = mssql_query("SELECT * FROM VPrivUser WHERE username='".$_SESSION['user_login']."' AND nama_menu='report'",$conn);
$rrep = mssql_fetch_array($srep);
// parameter data
$spar = mssql_query("SELECT * FROM VPrivUser WHERE username='".$_SESSION['user_login']."' AND nama_menu='parameter_data'",$conn);
$rpar = mssql_fetch_array($spar);
?>
	<tr>
	 <td colspan="2" align="left" class="line_bottom">
	  <table cellpadding="0" cellspacing="0">
	   <tr>
	    <td class="menu_top">&nbsp;&nbsp;<a href="#" onMouseOver="buttonMouseover(event,'Master');"><u>F</u>ile</a></td>
		<?
        if($rpar[baca] == 1 || $rpar[edit] == 1 || $rpar[hapus] == 1 || $rpar[tambah] == 1){
		?>
	    <td class="menu_top">&nbsp;&nbsp;<a href="#" onMouseOver="buttonMouseover(event,'PD');">Para<u>m</u>eter Data</a></td>
	    <?
		}
        if($radmu[baca] == 1 || $radmu[edit] == 1 || $radmu[hapus] == 1 || $radmu[tambah] == 1){
		?>
        <td class="menu_top">&nbsp;&nbsp;<a href="#" onMouseOver="buttonMouseover(event,'AU');">Administrasi <u>U</u>ser</a></td>
        <?
        }
		if($rcvoon[baca] == 1 || $rcvoon[edit] == 1 || $rcvoon[hapus] == 1 || $rcvoon[tambah] == 1){
		?>
	    <td class="menu_top">&nbsp;&nbsp;<a href="#" onMouseOver="buttonMouseover(event,'CV');">CV <u>O</u>NLINE</a></td>
        <?
        }
		if($rrep[baca] == 1 || $rrep[edit] == 1 || $rrep[hapus] == 1 || $rrep[tambah] == 1){		
		?>
   	    <td class="menu_top">&nbsp;&nbsp;<a href="#" onMouseOver="buttonMouseover(event,'Report');"><u>R</u>eport</a></td>
        <?
        }
		?>
	    <td class="menu_top">&nbsp;&nbsp;<a href="#" onMouseOver="buttonMouseover(event,'Bantuan');">Bantuan</a></td>
	    <td class="menu_top">&nbsp;&nbsp;<a href="#" onclick="logout();">Logout</a></td>
	   </tr>
	  </table>
	 </td>
	 <td class="line_bottom" align="right">
	 Anda login sebagai, <b>
     <?
     // get nama
	 $sN	= mssql_query("SELECT NIK, Nama FROM Karyawan WHERE NIK='".$HTTP_SESSION_VARS['user_login']."'",$conn);
	 if(mssql_num_rows($sN) > 0){
	 	$rN = mssql_fetch_array($sN);
		echo"$rN[Nama]";
	 }
	 else{
	 	echo $_SESSION['user_login'];
	 }
	 ?>
     </b> &nbsp;&nbsp;
	 </td>
	</tr>
</table>
<?
// master karyawan
$smst = mssql_query("SELECT * FROM VPrivUser WHERE username='".$HTTP_SESSION_VARS['user_login']."' AND nama_menu='master_karyawan'",$conn);
$rmst = mssql_fetch_array($smst);
// karir ptsi
$skar = mssql_query("SELECT * FROM VPrivUser WHERE username='".$HTTP_SESSION_VARS['user_login']."' AND nama_menu='karir_ptsi'",$conn);
$rkar = mssql_fetch_array($skar);
// sanksi
$ssnk = mssql_query("SELECT * FROM VPrivUser WHERE username='".$HTTP_SESSION_VARS['user_login']."' AND nama_menu='sanksi'",$conn);
$rsnk = mssql_fetch_array($ssnk);
// track record
$strc = mssql_query("SELECT * FROM VPrivUser WHERE username='".$HTTP_SESSION_VARS['user_login']."' AND nama_menu='track_record'",$conn);
$rtrc = mssql_fetch_array($strc);
// penugasan
$spenug = mssql_query("SELECT * FROM VPrivUser WHERE username='".$HTTP_SESSION_VARS['user_login']."' AND nama_menu='penugasan'",$conn);
$rpenug = mssql_fetch_array($spenug);
// penilaian
$snilai = mssql_query("SELECT * FROM VPrivUser WHERE username='".$HTTP_SESSION_VARS['user_login']."' AND nama_menu='penilaian'",$conn);
$rnilai = mssql_fetch_array($snilai);
// cuti
$scuti = mssql_query("SELECT * FROM VPrivUser WHERE username='".$HTTP_SESSION_VARS['user_login']."' AND nama_menu='cuti'",$conn);
$rcuti = mssql_fetch_array($scuti);
// medical
$smedical = mssql_query("SELECT * FROM VPrivUser WHERE username='".$HTTP_SESSION_VARS['user_login']."' AND nama_menu='medical'",$conn);
$rmedical = mssql_fetch_array($smedical);
// setup medical
$ssetup_med = mssql_query("SELECT * FROM VPrivUser WHERE username='".$HTTP_SESSION_VARS['user_login']."' AND nama_menu='setup_medical'",$conn);
$rsetup_med = mssql_fetch_array($ssetup_med);

?>
	  <DIV class="menu" id="Master">
	<?
      if($rmst[baca] == 1){
	?>
		  <A class="menuItem" 
		  <?
          if($rN[NIK] == $_SESSION['user_login']){
			  echo' href="/lib/detailemp.php?show=data_umum&nik='.$rN[NIK].'"';
		  }
		  else{
	          echo' href="/lib/show.php?show=employee"';
          }
		  ?>
          ><SPAN class=menuItemText>&bull; Master Karyawan</SPAN></A>
    <?
    	}
		
      if($rkar[baca] == 1){		
	?>
		  <A class="menuItem" 
          <?
		  if($rN[NIK] == $_SESSION['user_login']){
		  		echo'href="/lib/list_karir.php?show=list_karir&nik='.$rN[NIK].'"';
		  }
		  else{
	        	echo'href="/lib/show.php?show=karirptsi"';
		  }
		  ?>
          ><SPAN class=menuItemText>&bull; Karir di PT. SI</SPAN></A>
    <?
    	}
      if($rsnk[baca] == 1){	
	  // /lib/list_karir.php?show=list_sanksi&nik=			
	?>
		  <A class="menuItem" 
          <?
			  if($rN[NIK] == $_SESSION['user_login']){
					echo'href="/lib/list_karir.php?show=list_sanksi&nik='.$rN[NIK].'"';
			  }
			  else{
					echo'href="/lib/show.php?show=sanksi"';
			  }
		  ?>
          ><SPAN class=menuItemText>&bull; Sanksi</SPAN></A>
    <?
    }
	  if($rtrc[baca] == 1){			
	  // http://localhost:81/lib/list_karir.php?show=list_track_record&nik=66970495	
	?>
		  <A class="menuItem" 
          <?
			  if($rN[NIK] == $_SESSION['user_login']){
					echo'href="/lib/list_karir.php?show=list_track_record&nik='.$rN[NIK].'"';
			  }
			  else{
					echo'href="/lib/show.php?show=track_record"';
			  }
		  ?>
          ><SPAN class=menuItemText>&bull; Track Record</SPAN></A>
    <?
    }
	  if($rpenug[baca] == 1){				
	?>
		  <A class="menuItem" 
          <?
	  	  if($rN[NIK] == $_SESSION['user_login']){
          	echo'href="/lib/list_karir.php?show=list_tugas&nik='.$rN[NIK].'"';
		  }
		  else{
          	echo'href="/lib/show.php?show=penugasan"';
		  }
          ?>
          ><SPAN class=menuItemText>&bull; Penugasan</SPAN></A>
    <?
    }
	  if($rnilai[baca] == 1){				
	?>
		  <A class="menuItem" 
          <?
	  	  if($rN[NIK] == $_SESSION['user_login']){
          	echo'href="/lib/list_karir.php?show=list_nilai&nik='.$rN[NIK].'"';
			}
		  else{
          	echo'href="/lib/show.php?show=penilaian"';
			}
          ?>
          ><SPAN class=menuItemText>&bull; Penilaian</SPAN></A>
    <?
    }
	  if($rcuti[baca] == 1){				
	  //lib/listcuti.php?show=cuti_khusus&nik=16700765
	?>
		  <A class="menuItem" 
          <?
		  if($rN[NIK] == $_SESSION['user_login']){
		  echo'href="/lib/listcuti.php?show=cuti_khusus&nik='.$rN[NIK].'"';
		  }
		  else{
          echo'href="/lib/show.php?show=cuti"';
		  }
		  ?>
		  ><SPAN class=menuItemText>&bull; Cuti Karyawan</SPAN></A>
    <?
    }
	  if($rmedical[baca] == 1){				
	  //lib/listmedical.php?show=historical&nik=	
	?>
		  <A class="menuItem" 
          <?
		  if($rN[NIK] == $_SESSION['user_login']){
	      	echo'href="/lib/listmedical.php?show=historical&nik='.$rN[NIK].'"';
          }
		  else{
		  	echo'href="/lib/show.php?show=medical"';
		  }
		  ?>
          ><SPAN class=menuItemText>&bull; Medical</SPAN></A>
	<?
	}
   	  if($rsetup_med[baca] == 1){				
	?>
		  <A class="menuItem" 
          <?
		  if($rN[NIK] == $_SESSION['user_login']){
	        echo'href="/lib/listmedical.php?show=setup_medical&nik='.$rN[NIK].'"';
		  }
		  else{
		  	echo'href="/lib/show.php?show=setup_medical"';
		  }
          ?>
          ><SPAN class=menuItemText>&bull; Setup Data Medical</SPAN></A>
    <?
    }
	?>
	  </DIV>
<?
		if($rpar[baca] == 1 || $rpar[edit] == 1 || $rpar[hapus] == 1 || $rpar[tambah] == 1){	  
?>
	  <DIV class="menu" id="PD">
		  <A class="menuItem" href="/lib/show.php?show=par_lokasi"><SPAN class=menuItemText>&bull; Table Lokasi</SPAN></A>
		  <A class="menuItem" href="/lib/show.php?show=tbl_unit_kerja"><SPAN class=menuItemText>&bull; Table Unit Kerja</SPAN></A>
		  <A class="menuItem" href="/lib/show.php?show=par_lp2"><SPAN class=menuItemText>&bull; Table Unsur LP2</SPAN></A>
		  <A class="menuItem" href="/lib/show.php?show=cat_lp2"><SPAN class=menuItemText>&bull; Table Kategori Unsur LP2</SPAN></A>
		  <A class="menuItem" href="/lib/show.php?show=par_fungsional"><SPAN class=menuItemText>&bull; Table Fungsional</SPAN></A>
		  <A class="menuItem" href="/lib/show.php?show=par_jabatan"><SPAN class=menuItemText>&bull; Table Jabatan</SPAN></A>
		  <A class="menuItem" href="/lib/show.php?show=par_jns_cuti"><SPAN class=menuItemText>&bull; Table Jenis Cuti</SPAN></A>
		  <A class="menuItem" href="/lib/show.php?show=par_pendidikan"><SPAN class=menuItemText>&bull; Table Pendidikan</SPAN></A>
		  <A class="menuItem" href="/lib/show.php?show=par_bank"><SPAN class=menuItemText>&bull; Table Bank</SPAN></A>
		  <!--<A class="menuItem" href="#"><SPAN class=menuItemText>&bull; Table RKAP</SPAN></A>-->
		  <A class="menuItem" href="/lib/show.php?show=par_setup"><SPAN class=menuItemText>&bull; Parameter Setup</SPAN></A>
	  </DIV>
<?
		}
		if($radmu[baca] == 1 || $radmu[edit] == 1 || $radmu[hapus] == 1 || $radmu[tambah] == 1){
?>
	  <DIV class="menu" id="AU">
		  <A class="menuItem" href="/form/frm_adm_user.php"><SPAN class=menuItemText>&bull; Table User</SPAN></A>
		  <A class="menuItem" href="/form/frm_adm_group.php"><SPAN class=menuItemText>&bull; Table Group User</SPAN></A>
	  </DIV>
<?
		}
		if($rrep[baca] == 1 || $rrep[edit] == 1 || $rrep[hapus] == 1 || $rrep[tambah] == 1){		
?>
	  <DIV class="menu" id="Report">
		  <A class="menuItem" href="/report/rep_komp_naker.php" target="_blank" ><SPAN class=menuItemText>&bull; Komposisi Tenaga Kerja</SPAN></A>
		  <A class="menuItem" href="/report/rep_komp_naker.php" target="_blank" ><SPAN class=menuItemText>&bull; Statistik Kepegawaian</SPAN></A>
	  </DIV>
<?
		}
		if($rcvoon[baca] == 1 || $rcvoon[edit] == 1 || $rcvoon[hapus] == 1 || $rcvoon[tambah] == 1){		
?>
	  <DIV class="menu" id="CV">
		  <A class="menuItem" href="/lib/show.php?show=report_emp"><SPAN class=menuItemText>&bull; Cari CV</SPAN></A>
		  <A class="menuItem" href="/lib/show.php?show=log_book_cvonline"><SPAN class=menuItemText>&bull; Book Log Download CV</SPAN></A>
	  </DIV>
<?
		}
?>      
	  
	  <DIV class="menu" id="Bantuan">
		  <A class="menuItem" href="/form/frm_ch_pass.php"><SPAN class=menuItemText>&bull; Ubah Password</SPAN></A>
	  </DIV>
<?
//	mssql_free_result();
	mssql_close($conn);
?>